package lex.dm.id3;

import java.io.PrintStream;

public class DataSetUtils {

	public static void dump(IDataSet ds, PrintStream out) {
		for (int i = 0; i < ds.getAttributeCount(); i++) {
			out.print(ds.getAttribute(i));
			if (i < ds.getAttributeCount() - 1)
				out.print(", ");
		}
		char[] sep = new char[80];
		java.util.Arrays.fill(sep, '-');
		out.println();
		out.println(sep);
		for (int row = 0; row < ds.getRowCount(); row++) {
			for (int col = 0; col < ds.getColumnCount(); col++) {
				out.print(ds.getValue(row, col));
				if (col < ds.getColumnCount() - 1)
					out.print(", ");
			}
			out.println();
		}
	}
}
